** Bj�rnskov and Foss JBV paper
** For Steninge workshop, Jun 1-4, 2017
** Use dataset
use "C:\Users\chbj\Documents\Christian B\Niclas Andreas\Inherited Wellbeing\ESS1-6e01_1_F1.dta", clear
** Table 1
sum stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright  rlgdgr gndr agea livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant selfemployed_emp essround newwestern naceagriplus nacebeveragehotel

** Table 2
** Column 1 - all respondents
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround, fe vce(cluster countrycode)
** Column 2 - no immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==0 & halfimmigrant==0 & secondgenimmigrant==0 , fe vce(cluster countrycode)
** Column 3 - no first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==0 , fe vce(cluster countrycode)
** Column 4 - only first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==1 , fe vce(cluster countrycode)

** Lower panel - splitting small and large establishment self-employment
** Column 1 - all respondents
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround, fe vce(cluster countrycode)
** Column 2 - no immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if firstgenimmigrant==0 & halfimmigrant==0 & secondgenimmigrant==0 , fe vce(cluster countrycode)
** Column 3 - no first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if firstgenimmigrant==0 , fe vce(cluster countrycode)
** Column 4 - only first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if firstgenimmigrant==1 , fe vce(cluster countrycode)

** Table 3
** Column 1 - only non-Western immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==1 & newwestern ==0, fe vce(cluster countrycode)
** Column 2 - only Western immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==1 & newwestern ==1, fe vce(cluster countrycode)
** Column 3 - no agriculture, fishery, forestry, mining
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if naceagriplus==0, fe vce(cluster countrycode)
** Column 4 - no ag,no bureaucracy, no food or accommodation
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if naceagriplus==0 & nacebeveragehotel==0, fe vce(cluster countrycode)

** Lower panel - splitting small and large establishment self-employment
** Column 1 - only non-Western immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if firstgenimmigrant==1 & newwestern ==0, fe vce(cluster countrycode)
** Column 2 - only Western immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if firstgenimmigrant==1 & newwestern ==1, fe vce(cluster countrycode)
** Column 3 - no agriculture, fishery, forestry, mining
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if naceagriplus==0, fe vce(cluster countrycode)
** Column 4 - no ag,no bureaucracy, no food or accommodation
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if naceagriplus==0 & nacebeveragehotel==0, fe vce(cluster countrycode)

** Table 4
** Column 1 - all respondents
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround, fe vce(cluster countrycode)
** Column 2 - no immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==0 & halfimmigrant==0 & secondgenimmigrant==0 , fe vce(cluster countrycode)
** Column 3 - no first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==0 , fe vce(cluster countrycode)
** Column 4 - only first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemployed_emp i.essround if firstgenimmigrant==1 , fe vce(cluster countrycode)

** Low gov ief
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if lowgovheritage ==0, fe vce(cluster countrycode)
** High gov ief
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel selfemplbelow25 selfempl25to100 selfempllarge i.essround if lowgovheritage ==1, fe vce(cluster countrycode)

** Table separating opp and nec
** Column 1 - all respondents
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp5yr i.uemp5yr#i.selfemplbelow25 i.uemp5yr#i.selfempl25to100 i.uemp5yr#i.selfempllarge i.essround, fe vce(cluster countrycode)
** Column 2 - no immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp5yr i.uemp5yr#i.selfemplbelow25 i.uemp5yr#i.selfempl25to100 i.uemp5yr#i.selfempllarge i.essround if firstgenimmigrant==0 & halfimmigrant==0 & secondgenimmigrant==0 , fe vce(cluster countrycode)
** Column 3 - no first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp5yr i.uemp5yr#i.selfemplbelow25 i.uemp5yr#i.selfempl25to100 i.uemp5yr#i.selfempllarge i.essround if firstgenimmigrant==0 , fe vce(cluster countrycode)
** Column 4 - only first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp5yr i.uemp5yr#i.selfemplbelow25 i.uemp5yr#i.selfempl25to100 i.uemp5yr#i.selfempllarge i.essround if naceagriplus==0 & nacebeveragehotel==0 , fe vce(cluster countrycode)

** Unemployed last year
** Column 1 - all respondents
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp12m i.uemp12m#i.selfemplbelow25 i.uemp12m#i.selfempl25to100 i.uemp12m#i.selfempllarge i.essround, fe vce(cluster countrycode)
** Column 2 - no immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp12m i.uemp12m#i.selfemplbelow25 i.uemp12m#i.selfempl25to100 i.uemp12m#i.selfempllarge i.essround if firstgenimmigrant==0 & halfimmigrant==0 & secondgenimmigrant==0 , fe vce(cluster countrycode)
** Column 3 - no first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp12m i.uemp12m#i.selfemplbelow25 i.uemp12m#i.selfempl25to100 i.uemp12m#i.selfempllarge i.essround if firstgenimmigrant==0 , fe vce(cluster countrycode)
** Column 4 - only first generation immigrants
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.selfemplbelow25 i.selfempl25to100 i.selfempllarge i.uemp12m i.uemp12m#i.selfemplbelow25 i.uemp12m#i.selfempl25to100 i.uemp12m#i.selfempllarge i.essround if naceagriplus==0 & nacebeveragehotel==0 , fe vce(cluster countrycode)

** Most disaggregated
xtreg stflife ppltrst politicaltrust institutionaltrust lefttorightscale noleftright rlgdgr gndr c.agea c.agea#c.agea rtrd unemployed livewithpartner childrenathome childrenmovedout incomedecile firstgenimmigrant halfimmigrant secondgenimmigrant naceagriplus nacebeveragehotel i.estsz i.selfemployed_emp i.uemp5yr i.estsz#i.selfemployed_emp i.uemp5yr#selfemployed_emp i.estsz#i.selfemployed_emp i.uemp5yr#i.estsz#i.selfemployed_emp i.essround, fe vce(cluster countrycode)
